using System;
using System.Data;
using System.Collections.Generic;
using System.Text;

namespace demo_doan
{
    class LoaiDocGia : Interface
    {
        //attributes
        protected int maloaidocgia;
        protected string tenloaidocgia;
        //property
        public string TenLoaiDocGia
        {
            get { return tenloaidocgia; }
            set { tenloaidocgia = value; }
        }
	
        public int MaLoaiDocGia
        {
            get { return maloaidocgia; }
            set { maloaidocgia = value; }
        }
	    //buiding
        public LoaiDocGia() { }
        public LoaiDocGia(int maLDG, string tenLDG)
        {
            maloaidocgia = maLDG;
            tenloaidocgia = tenLDG;
        }
        public LoaiDocGia(LoaiDocGia ldg)
        {
            maloaidocgia = ldg.MaLoaiDocGia;
            tenloaidocgia = ldg.TenLoaiDocGia;
        }
        //method
        public override void  Insert(string sql)
        {
            Provider prv = new Provider("server=TILOM8X-PC\\SQLEXPRESS; Database=QuanLyThuVien; Integrated security=true");
            prv.ExeQuery(sql);
        }
        public override void  Update(string sql)
        {
            Provider prv = new Provider("server=TILOM8X-PC\\SQLEXPRESS; Database=QuanLyThuVien; Integrated security=true");
            prv.ExeQuery(sql);
        }
        public override void  Delete(string sql)
        {
            Provider prv = new Provider("server=TILOM8X-PC\\SQLEXPRESS; Database=QuanLyThuVien; Integrated security=true");
            prv.ExeQuery(sql);
        }
        public override DataTable Select(string sql)
        {
            Provider prv = new Provider("server=TILOM8X-PC\\SQLEXPRESS; Database=QuanLyThuVien; Integrated security=true");
            return prv.ExecuteQuery(sql);
        }
    }
}
